﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBHelper;
using BusinessLayer.FindArtInfo.Entities;
using System.Data.SqlClient;
using System.Data;

namespace BusinessLayer.FindArtInfo
{
    public class ArtistHomeBL
    {
        private readonly DbHelper _db;

        public ArtistHomeBL()
        {
            _db = new DbHelper(new DbConfig().DbFindArtInfoConnectionString);         
        }

        public ArtistHome GetRandom()
        {
            var oCommand = new SqlCommand("sp_ArtistHome_Select_Random") { CommandType = CommandType.StoredProcedure };
            var list = _db.GetList<ArtistHome>(oCommand);
            return list.FirstOrDefault(); 
        }
    }
}
